import pymysql

conn = pymysql.connect(host='localhost',user='root',passwd='123456',db='room')

print("数据库连接成功")

cursor = conn.cursor()

f = open("1.jpeg","rb")
img = f.read()
f.close()

sql = '''
insert into clothes
value(%s,%s,%s,%s)
'''
args = (1,img,'cscd','d')

cursor.execute(sql,args)

cursor.close()

conn.cursor()